<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>CSS优先级</title>
    <style>
      /* 类选择器/伪类选择器 权重 0,0,1,0 */
      .test {
        color: red;
      }
      /* 元素选择器权重 0,0,0,1 */
      div {
        /* !important 权重为无穷大 */
        color: pink !important;
      }
      /* ID选择器权重 0,1,0,0 */
      #demo {
        color: green;
      }
    </style>
  </head>
  <body>
    <!--  行内样式权重 1,0,0,0  -->
    <div class="test" id="demo" style="color: purple;">你笑起来真好看</div>
  </body>
</html>
